import request from '@/utils/request.js'

/**
 * @description: 获取角色列表
 * @param {*} params:{page, pageSize}
 * @return {*}
 */
// 获取角色列表接口
export function getRoleList (params) {
  return request({
    url: '/sys/role',
    params
  })
}

// 删除角色的API
export const deleteRole = (id) => {
  return request.delete(`/sys/role/${id}`)
}

// 新增
export const addRole = (data) => {
  return request.post('/sys/role', data)
}

// 获取角色详情
export const getRoleDetail = (id) => {
  return request.get(`/sys/role/${id}`)
}

// 编辑
export const updateRole = (data) => {
  return request.put(`/sys/role/${data.id}`, data)
}
